//
//  TwoViewController.m
//  LoginDemo
//
//  Created by XFB on 2017/6/14.
//  Copyright © 2017年 ZC. All rights reserved.
//

#import "TwoViewController.h"
#import "CusutomNaviBar.h"

@interface TwoViewController () <CusutomNaviBarDelegate>

@property (nonatomic, strong) CusutomNaviBar *customNaviBar;

@end

@implementation TwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor redColor];
    
    [self.navigationController setNavigationBarHidden:YES animated:NO];
    self.fd_prefersNavigationBarHidden = YES;
        
    self.customNaviBar = [[CusutomNaviBar alloc] init];
    self.customNaviBar.delegate = self;
    self.customNaviBar.backgroundColor = [UIColor lightGrayColor];
    self.customNaviBar.title = @"测试Demo";
    self.customNaviBar.titleColor = [UIColor whiteColor];
    self.customNaviBar.leftImage = @"header_leftbtn_nor_original";
    self.customNaviBar.rightImage = @"header_icon_add_original";
    [self.view addSubview:self.customNaviBar];

}

#pragma mark --- <CusutomNaviBarDelegate>

- (void)customNaviBarLeftButtonClick
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)customNaviBarRightButtonClick
{
    // 没有导航栏 -> 跳转到导航栏
    //    OneViewController *oneVc = [[OneViewController alloc] init];
    //    [self.navigationController pushViewController:oneVc animated:YES];
    
    // 没有导航栏 -> 跳转到没有导航栏
    TwoViewController *vc = [[TwoViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}


@end
